home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / WIN_PRO / BARVBX.ZIP;1 / SAMPLE.ZIP / FORM1.FRM (.txt) next >
Encoding:
Visual Basic Form  |  1993-11-01  |  3.4 KB  |  128 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "BarCode/VBX"
  4.    ClientHeight    =   2772
  5.    ClientLeft      =   540
  6.    ClientTop       =   1884
  7.    ClientWidth     =   5856
  8.    Height          =   3192
  9.    Left            =   492
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   2772
  12.    ScaleWidth      =   5856
  13.    Top             =   1512
  14.    Width           =   5952
  15.    Begin CommandButton Command2 
  16.       Caption         =   "&Bound Sample..."
  17.       Height          =   432
  18.       Left            =   3720
  19.       TabIndex        =   4
  20.       Top             =   2160
  21.       Width           =   1992
  22.    End
  23.    Begin CommonDialog CMDialog1 
  24.       CancelError     =   -1  'True
  25.       Left            =   3960
  26.       PrinterDefault  =   0   'False
  27.       Top             =   180
  28.    End
  29.    Begin CommandButton Command1 
  30.       Cancel          =   -1  'True
  31.       Caption         =   "&Cancel"
  32.       Height          =   432
  33.       Left            =   1860
  34.       TabIndex        =   2
  35.       Top             =   2160
  36.       Width           =   1752
  37.    End
  38.    Begin BarCode BarCode1 
  39.       BarCodeType     =   0  'Code 3 of 9
  40.       Checksum        =   1
  41.       Height          =   672
  42.       Left            =   60
  43.       NarrowBarWidth  =   2
  44.       Ratio           =   0  '3:1
  45.       Rotation        =   0  'Normal
  46.       Text            =   ""
  47.       Top             =   600
  48.       Width           =   3456
  49.    End
  50.    Begin CommandButton Print 
  51.       Caption         =   "&Print"
  52.       Height          =   432
  53.       Left            =   60
  54.       TabIndex        =   1
  55.       Top             =   2160
  56.       Width           =   1692
  57.    End
  58.    Begin TextBox Text1 
  59.       Height          =   372
  60.       Left            =   60
  61.       TabIndex        =   0
  62.       Text            =   "Text1"
  63.       Top             =   180
  64.       Width           =   3072
  65.    End
  66.    Begin Label Label1 
  67.       Caption         =   "Double Click on BarCode to set Properties."
  68.       Height          =   312
  69.       Left            =   60
  70.       TabIndex        =   3
  71.       Top             =   1620
  72.       Width           =   4332
  73.    End
  74. Sub BarCode1_DblClick ()
  75.     Form2.Show 1
  76. End Sub
  77. Sub Command1_Click ()
  78.     End
  79. End Sub
  80. Sub Command2_Click ()
  81.     Form3.Show 1
  82. End Sub
  83. Sub Form_Load ()
  84.     Text1.Text = "123456"
  85. End Sub
  86. Sub Print_Click ()
  87.     Dim PSC As BARCODEPRINTDATA
  88.     Dim DOCINFO As DOCINFO
  89.     Dim StopPrint As Integer
  90.     StopPrint = False
  91.     On Error GoTo PrintErr:
  92.                    
  93.     CMDialog1.Flags = PD_RETURNDC Or PD_PRINTSETUP
  94.     CMDialog1.Action = 5
  95.     If StopPrint = False Then
  96.     DOCINFO.cbSize = 0
  97.     DOCINFO.DocName = 0
  98.     DOCINFO.Output = 0
  99.     PSC.BarCodeType = BarCode1.BarCodeType
  100.     PSC.Checksum = BarCode1.Checksum
  101.     PSC.Text = Text1.Text & Chr(0)
  102.     PSC.x = 0
  103.     PSC.y = 0
  104.     PSC.Height = 100
  105.     PSC.Rotation = 0
  106.     PSC.NarrowBarWidth = BarCode1.NarrowBarWidth * 2
  107.     PSC.Ratio = BarCode1.Ratio
  108.     PSC.hDC = CMDialog1.hDC
  109.     Ok = StartDoc(CMDialog1.hDC, DOCINFO)
  110.     Ok = StartPage(CMDialog1.hDC)
  111.     Ok = BarCodePrint(PSC)
  112.     If Ok = False Then
  113.         MsgBox BarCodeGetLastErrorString()
  114.     End If
  115.     Ok = EndPage(CMDialog1.hDC)
  116.     Ok = EndDocAPI(CMDialog1.hDC)
  117.     Ok = DeleteDC(CMDialog1.hDC)
  118.     End If
  119.     On Error GoTo 0
  120. Exit Sub
  121. PrintErr:
  122.     StopPrint = True
  123.     Resume Next
  124. End Sub
  125. Sub Text1_Change ()
  126.     BarCode1.Text = Text1.Text
  127. End Sub
  128.